local pingtao = fk.CreateSkill {
  name = "pingtao",
}

pingtao:addEffect("active", {
  anim_type = "offensive",
  card_num = 0,
  target_num = 1,
  prompt = "#pingtao",
  can_use = function(self, player)
    return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter =function (self, player, to_select, selected, selected_cards, card, extra_data)
    return #selected == 0 and to_select ~= player
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local card = room:askForCard(target, 1, 1, true, self.name, true, ".", "#pingtao-card:"..player.id)
    if #card > 0 then
      room:moveCardTo(Fk:getCardById(card[1]), Card.PlayerHand, player, fk.ReasonGive, self.name, nil, false, target)
      room:addPlayerMark(player, MarkEnum.SlashResidue.."-phase", 1)
    else
      room:useVirtualCard("slash", nil, player, target, self.name, true)
    end
  end,
})

return pingtao